package com.fc.test.service;

import java.util.List;

import com.fc.test.model.auto.TAbbCount;
import com.fc.test.model.auto.TAbbCountExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.fc.test.common.base.BaseService;
import com.fc.test.common.support.Convert;
import com.fc.test.mapper.auto.TAbbCxzifeiMapper;
import com.fc.test.model.auto.TAbbCxzifei;
import com.fc.test.model.auto.TAbbCxzifeiExample;
import com.fc.test.model.custom.Tablepar;
import com.fc.test.util.SnowflakeIdWorker;

/**
 * Service
* @Title: TAbbCxzifeiService.java 
* @Package com.fc.test.entity 
* @author fuce
* @email 87766867@qq.com
* @date 2019-10-26 16:02:29  
 */
@Service
public class TAbbCxzifeiService implements BaseService<TAbbCxzifei, TAbbCxzifeiExample>{
	@Autowired
	private TAbbCxzifeiMapper tAbbCxzifeiMapper;

	/**
	 * 分页查询
	 * @return
	 */
	public PageInfo<TAbbCxzifei> list(Tablepar tablepar,String name){
		TAbbCxzifeiExample testExample=new TAbbCxzifeiExample();
		testExample.setOrderByClause("id ASC");

		PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
		List<TAbbCxzifei> list= tAbbCxzifeiMapper.selectByExample(testExample);
		PageInfo<TAbbCxzifei> pageInfo = new PageInfo<TAbbCxzifei>(list);
		return  pageInfo;
	}

	@Override
	public int deleteByPrimaryKey(String ids) {
		List<String> lista=Convert.toListStrArray(ids);
		TAbbCxzifeiExample example=new TAbbCxzifeiExample();
		example.createCriteria().andIdIn(lista);
		return tAbbCxzifeiMapper.deleteByExample(example);
	}


	@Override
	public TAbbCxzifei selectByPrimaryKey(String id) {

		return tAbbCxzifeiMapper.selectByPrimaryKey(id);
	}


	@Override
	public int updateByPrimaryKeySelective(TAbbCxzifei record) {
		return tAbbCxzifeiMapper.updateByPrimaryKeySelective(record);
	}

	/**
	 * 添加
	 */
	@Override
	public int insertSelective(TAbbCxzifei record) {
		//添加雪花主键id
		record.setId(SnowflakeIdWorker.getUUID());
		return tAbbCxzifeiMapper.insertSelective(record);
	}










	@Override
	public int updateByExampleSelective(TAbbCxzifei record, TAbbCxzifeiExample example) {

		return tAbbCxzifeiMapper.updateByExampleSelective(record, example);
	}


	@Override
	public int updateByExample(TAbbCxzifei record, TAbbCxzifeiExample example) {

		return tAbbCxzifeiMapper.updateByExample(record, example);
	}

	@Override
	public List<TAbbCxzifei> selectByExample(TAbbCxzifeiExample example) {

		return tAbbCxzifeiMapper.selectByExample(example);
	}


	@Override
	public long countByExample(TAbbCxzifeiExample example) {

		return tAbbCxzifeiMapper.countByExample(example);
	}


	@Override
	public int deleteByExample(TAbbCxzifeiExample example) {

		return tAbbCxzifeiMapper.deleteByExample(example);
	}


	public TAbbCxzifei selectLimitone(){
		return tAbbCxzifeiMapper.selectLimitone();
	}



}
